package cn.classg.rabbitmq.factory;

import org.springframework.amqp.core.Binding;
import org.springframework.beans.factory.FactoryBean;

/**
 * @author CLASSG
 */
public class MessageBindingFactoryBean implements FactoryBean<Binding> {

    private String queueName;
    private String exchangeName;
    private String routeKey;

    public MessageBindingFactoryBean(String queueName, String exchangeName, String routeKey) {
        this.queueName = queueName;
        this.exchangeName = exchangeName;
        this.routeKey = routeKey;
    }

    @Override
    public Binding getObject() {
        return new Binding(this.queueName, Binding.DestinationType.QUEUE, this.exchangeName, this.routeKey, null);
    }

    @Override
    public Class<?> getObjectType() {
        return Binding.class;
    }


}
